DMR files
Negative control
files.nc <- list.files(path = "./input", pattern = "neg_control.txt", full.names = T)
files.nc <- files.nc[grep(pattern = "anno", x = files.nc, invert = T)]
names(files.nc) <- sapply(files.nc, function(x) strsplit(x, "\\.|/")[[1]][4])
read.nc <- lapply(files.nc, function(x) GRanges(read.delim(x, sep = "\t", stringsAsFactors = F, header = T)))
Simulated data
anno.sim <- read.table("./input/anno_sim_data.txt.gz", sep = "\t", header = T, stringsAsFactors = F)
files.sim <- list.files(path = "./input", pattern = "sim_data.txt", full.names = T)
files.sim <- files.sim[grep(pattern = "anno", x = files.sim, invert = T)]
names(files.sim) <- sapply(files.sim, function(x) strsplit(x, "\\.|/")[[1]][4])
read.sim <- lapply(files.sim, function(x) {
a <- read.delim(x, sep = "\t", stringsAsFactors = F, header = T)
cols <- colnames(a)
if (length(cols[grep(pattern = "qval", x = cols)]) == 0) {
return(GRanges(a))
} else {
b <- GRanges(a)
b <- b[b$qval <= 0.05, ]
return(b)
}
})
pData(bs.sim$bs) <- anno.sim
Regions plot Simulated data
## DMRs
dmrs <- data.frame(bs.sim$gr.dmrs, mncov = bs.sim$dmr.mncov, delta = bs.sim$delta)
dmrs <- GRanges(dmrs[order(dmrs$delta, decreasing = T), ])
## Results to be plotted
n1 <- paste(names(read.sim)[2:5], collapse = " | ")
n1 <- gsub(pattern = "_dmr|_sim_data", replacement = "", x = n1)
n2 <- paste(names(read.sim)[6:9], collapse = " | ")
n2 <- gsub(pattern = "_dmr|_sim_data", replacement = "", x = n2)
n3 <- paste(names(read.sim)[c(1, 10:12)], collapse = " | ")
n3 <- gsub(pattern = "_dmr|_sim_data", replacement = "", x = n3)
for (i in 1:100) {
n <- paste0("Region", i, ": ", "delta ", round(dmrs$delta[i], 3))
cat("\n \n")
cat(paste("##", n))
cat("\n \n")
plotDMRs(
BSseq = bs.sim$bs, regions = dmrs[i, ], testCovariate = "Group",
compareTrack = GenomicRangesList(read.sim[c(2:5)]), qval = F, stat = F,
highlightMain = F,
main = n1
)
plotDMRs(
BSseq = bs.sim$bs, regions = dmrs[i, ], testCovariate = "Group",
compareTrack = GenomicRangesList(read.sim[c(6:9)]), qval = F, stat = F,
highlightMain = F,
main = n2
)
plotDMRs(
BSseq = bs.sim$bs, regions = dmrs[i, ], testCovariate = "Group",
compareTrack = GenomicRangesList(read.sim[c(1, 10:12)]), qval = F, stat = F,
highlightMain = F,
main = n3
)
cat("\n \n")
}
SessionInfo
## ─ Session info ──────────────────────────────────────────────────────────
## setting value
## version R version 3.5.1 (2018-07-02)
## os Ubuntu 16.04.5 LTS
## system x86_64, linux-gnu
## ui X11
## language (EN)
## collate en_US.UTF-8
## ctype en_US.UTF-8
## tz Europe/Zurich
## date 2019-01-07
##
## ─ Packages ──────────────────────────────────────────────────────────────
## package * version date lib source
## AnnotationDbi 1.42.1 2018-10-04 [1] Bioconductor
## AnnotationHub 2.12.1 2018-09-05 [1] Bioconductor
## annotatr 1.6.0 2018-10-04 [1] Bioconductor
## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1)
## backports 1.1.3 2018-12-14 [1] CRAN (R 3.5.1)
## bibtex 0.4.2 2017-06-30 [1] CRAN (R 3.5.1)
## bindr 0.1.1 2018-03-13 [1] CRAN (R 3.5.1)
## bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.5.1)
## Biobase * 2.40.0 2018-10-04 [1] Bioconductor
## BiocGenerics * 0.26.0 2018-10-04 [1] Bioconductor
## BiocInstaller 1.30.0 2018-10-04 [1] Bioconductor
## BiocParallel * 1.14.2 2018-07-08 [1] Bioconductor
## biomaRt 2.36.1 2018-10-29 [1] Bioconductor
## Biostrings 2.48.0 2018-10-29 [1] Bioconductor
## bit 1.1-14 2018-05-29 [1] CRAN (R 3.5.1)
## bit64 0.9-7 2017-05-08 [1] CRAN (R 3.5.1)
## bitops 1.0-6 2013-08-17 [1] CRAN (R 3.5.1)
## blob 1.1.1 2018-03-25 [1] CRAN (R 3.5.1)
## BSgenome 1.48.0 2018-10-04 [1] Bioconductor
## bsseq * 1.16.1 2018-06-14 [1] Bioconductor
## bumphunter 1.22.0 2018-10-04 [1] Bioconductor
## callr 3.1.1 2018-12-21 [1] CRAN (R 3.5.1)
## cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.1)
## codetools 0.2-16 2018-12-24 [1] CRAN (R 3.5.1)
## colorspace 1.3-2 2016-12-14 [1] CRAN (R 3.5.1)
## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1)
## data.table 1.11.8 2018-09-30 [1] CRAN (R 3.5.1)
## DBI 1.0.0 2018-05-02 [1] CRAN (R 3.5.1)
## DelayedArray * 0.6.6 2018-09-11 [1] Bioconductor
## DelayedMatrixStats 1.2.0 2018-10-04 [1] Bioconductor
## desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.1)
## devtools 2.0.1 2018-10-26 [1] CRAN (R 3.5.1)
## digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1)
## dmrseq * 1.0.14 2018-08-07 [1] Bioconductor
## doRNG 1.7.1 2018-06-22 [1] CRAN (R 3.5.1)
## dplyr 0.7.8 2018-11-10 [1] CRAN (R 3.5.1)
## evaluate 0.12 2018-10-09 [1] CRAN (R 3.5.1)
## foreach 1.4.4 2017-12-12 [1] CRAN (R 3.5.1)
## fs 1.2.6 2018-08-23 [1] CRAN (R 3.5.1)
## GenomeInfoDb * 1.16.0 2018-10-04 [1] Bioconductor
## GenomeInfoDbData 1.1.0 2018-10-04 [1] Bioconductor
## GenomicAlignments 1.16.0 2018-10-04 [1] Bioconductor
## GenomicFeatures 1.32.3 2018-10-05 [1] Bioconductor
## GenomicRanges * 1.32.7 2018-09-20 [1] Bioconductor
## ggplot2 3.1.0 2018-10-25 [1] CRAN (R 3.5.1)
## glue 1.3.0 2018-07-17 [1] CRAN (R 3.5.1)
## gtable 0.2.0 2016-02-26 [1] CRAN (R 3.5.1)
## gtools 3.8.1 2018-06-26 [1] CRAN (R 3.5.1)
## HDF5Array 1.8.1 2018-06-21 [1] Bioconductor
## hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.1)
## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1)
## httpuv 1.4.5.1 2018-12-18 [1] CRAN (R 3.5.1)
## httr 1.4.0 2018-12-11 [1] CRAN (R 3.5.1)
## interactiveDisplayBase 1.18.0 2018-10-04 [1] Bioconductor
## IRanges * 2.14.12 2018-09-20 [1] Bioconductor
## iterators 1.0.10 2018-07-13 [1] CRAN (R 3.5.1)
## knitr 1.21 2018-12-10 [1] CRAN (R 3.5.1)
## later 0.7.5 2018-09-18 [1] CRAN (R 3.5.1)
## lattice 0.20-38 2018-11-04 [1] CRAN (R 3.5.1)
## lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.5.1)
## limma 3.36.5 2018-09-20 [1] Bioconductor
## locfit 1.5-9.1 2013-04-20 [1] CRAN (R 3.5.1)
## magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.1)
## Matrix 1.2-15 2018-11-01 [1] CRAN (R 3.5.1)
## matrixStats * 0.54.0 2018-07-23 [1] CRAN (R 3.5.1)
## memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.1)
## mime 0.6 2018-10-05 [1] CRAN (R 3.5.1)
## munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.1)
## nlme 3.1-137 2018-04-07 [1] CRAN (R 3.5.1)
## outliers 0.14 2011-01-24 [1] CRAN (R 3.5.1)
## permute 0.9-4 2016-09-09 [1] CRAN (R 3.5.1)
## pillar 1.3.1 2018-12-15 [1] CRAN (R 3.5.1)
## pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.5.1)
## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1)
## pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.1)
## pkgmaker 0.27 2018-05-25 [1] CRAN (R 3.5.1)
## plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.1)
## prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.1)
## processx 3.2.1 2018-12-05 [1] CRAN (R 3.5.1)
## progress 1.2.0 2018-06-14 [1] CRAN (R 3.5.1)
## promises 1.0.1 2018-04-13 [1] CRAN (R 3.5.1)
## ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.1)
## purrr 0.2.5 2018-05-29 [1] CRAN (R 3.5.1)
## R.methodsS3 1.7.1 2016-02-16 [1] CRAN (R 3.5.1)
## R.oo 1.22.0 2018-04-22 [1] CRAN (R 3.5.1)
## R.utils 2.7.0 2018-08-27 [1] CRAN (R 3.5.1)
## R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.1)
## RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 3.5.1)
## Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.5.1)
## RCurl 1.95-4.11 2018-07-15 [1] CRAN (R 3.5.1)
## readr 1.3.1 2018-12-21 [1] CRAN (R 3.5.1)
## regioneR 1.12.0 2018-10-04 [1] Bioconductor
## registry 0.5 2017-12-03 [1] CRAN (R 3.5.1)
## remotes 2.0.2 2018-10-30 [1] CRAN (R 3.5.1)
## reshape2 1.4.3 2017-12-11 [1] CRAN (R 3.5.1)
## rhdf5 2.24.0 2018-10-04 [1] Bioconductor
## Rhdf5lib 1.2.1 2018-10-04 [1] Bioconductor
## rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1)
## rmarkdown 1.11 2018-12-08 [1] CRAN (R 3.5.1)
## rngtools 1.3.1 2018-05-15 [1] CRAN (R 3.5.1)
## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.1)
## Rsamtools 1.32.3 2018-08-22 [1] Bioconductor
## RSQLite 2.1.1 2018-05-06 [1] CRAN (R 3.5.1)
## rtracklayer 1.40.6 2018-08-31 [1] Bioconductor
## S4Vectors * 0.18.3 2018-10-04 [1] Bioconductor
## scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.1)
## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.1)
## shiny 1.2.0 2018-11-02 [1] CRAN (R 3.5.1)
## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.1)
## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.1)
## SummarizedExperiment * 1.10.1 2018-10-04 [1] Bioconductor
## testthat 2.0.1 2018-10-13 [1] CRAN (R 3.5.1)
## tibble 1.4.2 2018-01-22 [1] CRAN (R 3.5.1)
## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1)
## usethis 1.4.0 2018-08-14 [1] CRAN (R 3.5.1)
## withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1)
## xfun 0.4 2018-10-23 [1] CRAN (R 3.5.1)
## XML 3.98-1.16 2018-08-19 [1] CRAN (R 3.5.1)
## xtable 1.8-3 2018-08-29 [1] CRAN (R 3.5.1)
## XVector 0.20.0 2018-10-04 [1] Bioconductor
## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1)
## zlibbioc 1.26.0 2018-10-04 [1] Bioconductor
##
## [1] /home/ubuntu/R/x86_64-pc-linux-gnu-library/3.5
## [2] /usr/local/lib/R/site-library
## [3] /usr/lib/R/site-library
## [4] /usr/lib/R/library